import Main from '@/views/Main.vue';

// 不作为Main组件的子页面展示的页面单独写，如下
export const loginRouter = {
    path: '/login',
    name: 'login',
    meta: {
        title: 'Login - 登录'
    },
    component: () => import('@/views/login.vue')
};

export const page404 = {
    path: '/*',
    name: 'error-404',
    meta: {
        title: '404-页面不存在'
    },
    component: () => import('@/views/error-page/404.vue')
};

export const page403 = {
    path: '/403',
    meta: {
        title: '403-权限不足'
    },
    name: 'error-403',
    component: () => import('@//views/error-page/403.vue')
};

export const page500 = {
    path: '/500',
    meta: {
        title: '500-服务端错误'
    },
    name: 'error-500',
    component: () => import('@/views/error-page/500.vue')
};

// export const preview = {
//     path: '/preview',
//     name: 'preview',
//     component: () => import('@/views/form/article-publish/preview.vue')
// };

export const locking = {
    path: '/locking',
    name: 'locking',
    component: () => import('@/views/main-components/lockscreen/components/locking-page.vue')
};

// 作为Main组件的子页面展示但是不在左侧菜单显示的路由写在otherRouter里
export const otherRouter = {
    path: '/',
    name: 'otherRouter',
    redirect: '/home',
    access: [0,1,3],
    component: Main,
    children: [
        { path: 'home', title: {i18n: 'home'},  name: 'home_index', component: () => import('@/views/home/home.vue') },
        { path: 'ownspace', title: '个人中心', name: 'ownspace_index', component: () => import('@/views/own-space/own-space.vue') },
        { path: 'message', title: '消息中心', name: 'message_index', component: () => import('@/views/message/message.vue') },
        { path: 'shoppingChange', title: '商品编辑', name: 'shoppingChange', component: () => import('@/views/mall/shoppingChange.vue') }, // 用于展示带参路由

    ]
};

// 作为Main组件的子页面展示并且在左侧菜单显示的路由写在appRouter里
export const appRouter = [
    {
        path: '/component',
        icon: 'social-buffer',
        name: 'component',
        access: 10,
        title: '组件',
        component: Main,
        children: [
            {
                path: 'text-editor',
                icon: 'compose',
                name: 'text-editor',
                title: '富文本编辑器',
                component: () => import('@/views/my-components/text-editor/text-editor.vue')
            },
            {
                path: 'md-editor',
                icon: 'pound',
                name: 'md-editor',
                title: 'Markdown编辑器',
                component: () => import('@/views/my-components/markdown-editor/markdown-editor.vue')
            },
            {
                path: 'image-editor',
                icon: 'crop',
                name: 'image-editor',
                title: '图片预览编辑',
                component: () => import('@/views/my-components/image-editor/image-editor.vue')
            },
            {
                path: 'draggable-list',
                icon: 'arrow-move',
                name: 'draggable-list',
                title: '可拖拽列表',
                component: () => import('@/views/my-components/draggable-list/draggable-list.vue')
            },
            {
                path: 'area-linkage',
                icon: 'ios-more',
                name: 'area-linkage',
                title: '城市级联',
                component: () => import('@/views/my-components/area-linkage/area-linkage.vue')
            },
            {
                path: 'file-upload',
                icon: 'android-upload',
                name: 'file-upload',
                title: '文件上传',
                component: () => import('@/views/my-components/file-upload/file-upload.vue')
            },
            {
                path: 'scroll-bar',
                icon: 'android-upload',
                name: 'scroll-bar',
                title: '滚动条',
                component: () => import('@/views/my-components/scroll-bar/scroll-bar-page.vue')
            },
            {
                path: 'count-to',
                icon: 'arrow-graph-up-right',
                name: 'count-to',
                title: '数字渐变',
                // component: () => import('@/views/my-components/count-to/count-to.vue')
                component: () => import('@/views/my-components/count-to/count-to.vue')
            },
            {
                path: 'split-pane-page',
                icon: 'ios-pause',
                name: 'split-pane-page',
                title: 'split-pane',
                component: () => import('@/views/my-components/split-pane/split-pane-page.vue')
            }
        ]
    },
    {
        path: '/form',
        icon: 'android-checkbox',
        name: 'form',
        access: 10,
        title: '表单编辑',
        component: Main,
        children: [
            { path: 'artical-publish', title: '公告编辑', name: 'artical-publish', icon: 'compose', component: () => import('@/views/form/article-publish/article-publish.vue') },
            { path: 'workflow', title: '工作流', name: 'workflow', icon: 'arrow-swap', component: () => import('@/views/form/work-flow/work-flow.vue') },
            { path: 'preview', title: '公告浏览', name: 'preview', icon: 'arrow-swap', component: () => import('@/views/form/article-publish/preview.vue') }

        ]
    },
    {
        path: '/user-management',
        icon: 'key',
        name: 'user-management',
        title: '管理员管理',
        component: Main,
        children: [
            {
                path: 'vip',
                title: '管理员管理',
                access: 0,
                name: 'vip',
                component: () => import('@/views/user-management/vip.vue')
            },

            {
                path: 'vipLogin',
                title: '管理员登录日志',
                access: 0,
                name: 'vipLogin',
                component: () => import('@/views/user-management/vipLogin.vue')
            }
        ]
    },
    {
        path: '/sumasss',
        icon: 'person',
        name: 'sumasss',
        title: '用户列表',
        component: Main,
        children: [
            {
                path: 'user',
                title: '用户列表',
                name: 'userList',
                component: () => import('@/views/user-management/userList.vue')
            }
        ]
    },
    {
        path: '/sumassss',
        icon: 'person',
        name: 'sumassss',
        title: '用户列表',
        access: [0,1,3],
        component: Main,
        showAlways: true,
        children: [
            {
                path: 'assets',
                title: '用户资产列表',
                name: 'assets',
                component: () => import('@/views/user-management/assets.vue')
            }
        ]
    },
    {
        path: '/fee',
        icon: 'person',
        name: 'fee',
        title: '手续费',
        access: 0,
        component: Main,
        children: [
            {
                path: 'feeList',
                title: '手续费列表',
                name: 'feeList',
                component: () => import('@/views/fee/feeList.vue')
            }

        ]
    },
    {
        path: '/sumass',
        icon: 'earth',
        name: 'sumass',
        title: '平台总资产',
        access: [0,3],
        component: Main,
        children: [
            { path: 'sumas', icon: 'earth', title: '平台总资产', name: 'sumas',
                component: () => import('@/views/sumas/sumas.vue') }

        ]
    },
    {
        path: '/surper',
        icon: 'social-buffer',
        name: 'surper',
        title: '超管操作记录',
        access: 0,
        component: Main,
        children: [
            { path: 'surperIndex', icon: 'social-buffer', title: '超管操作记录', name: 'surperIndex',
                component: () => import('@/views/surper/surper.vue') }

        ]
    },
    {
        path: '/trader',
        icon: 'briefcase',
        name: 'trader',
        title: '操盘手记录',
        access: 0,
        component: Main,
        children: [
            { path: 'traders', icon: 'briefcase', title: '操盘手记录', name: 'traders',
                component: () => import('@/views/traders/traders.vue') }
        ]
    },
    {
        path: '/usrejf',
        icon: 'ios-grid-view',
        name: 'usrejf',
        title: '用户积分管理',
        access: [0,1],
        component: Main,
        children: [
            {
                path: 'jfList',
                title: '用户积分修改',
                name: 'identityIndexs',
                component: () => import('@/views/userjf/jfList.vue')
            },
            {
                path: 'jfxgList',
                title: '用户积分修改列表',
                name: 'jfxgList',
                component: () => import('@/views/userjf/jfxgList.vue')
            }
        ]
    },
    {
        path: '/top-up',
        icon: 'log-in',
        name: 'top-up',
        title: '充值记录',
        access: [0,1,3],
        component: Main,
        children: [
            { path: 'usd', title: 'USDI充值记录', name: 'usd',
                component: () => import('@/views/top-up/usd.vue') },
            { path: 'aitc', title: 'AITC充值记录', name: 'aitc',
                component: () => import('@/views/top-up/aitc.vue') }
        ]
    },
    {
        path: '/withdrawal',
        icon: 'ios-infinite',
        name: 'withdrawal',
        title: '提现记录',
        access: [0,1,3,4],
        component: Main,
        children: [
            { path: 'usbtxsh', title: 'USDI提现审核', name: 'usbtxsh',
                component: () => import('@/views/withdrawal/eth.vue') },
            { path: 'txjl', title: '提现记录', name: 'txjl',
                component: () => import('@/views/withdrawal/aitc.vue') }
        ]
    },
    {
        path: '/ccmx',
        icon: 'android-clipboard',
        name: 'ccmx',
        access: [0,1,3],
        title: '持仓明细',
        component: Main,
        children: [
            { path: 'ccmxs', title: '持仓明细', name: 'ccmxs',
                // icon: 'link',
                component: () => import('@/views/ccmx/ccmx.vue') },
        ]
    },
    {
        path: '/transfer',
        icon: 'shuffle',
        access: [0,1],
        title: '转账记录',
        name: 'transfer',
        component: Main,
        children: [
            {
                path: 'jlsc',
                title: '转入锁仓转账',
                name: 'jlsc',
                component: () => import('@/views/transfer/usd.vue')
            },
            {
                path: 'aitcsc',
                title: 'AITC锁仓转账',
                name: 'aitcsc',
                component: () => import('@/views/transfer/aitcsc.vue')
            },
            {
                path: 'aitcsf',
                title: 'AITC释放转账',
                name: 'aitcsf',
                component: () => import('@/views/transfer/aitcsf.vue')
            },
            {
                path: 'kssc',
                title: '矿石本金(锁仓)',
                name: 'kssc',
                component: () => import('@/views/transfer/kssc.vue')
            },
            {
                path: 'kssf',
                title: '矿石释放',
                name: 'kssf',
                component: () => import('@/views/transfer/kssf.vue')
            }
        ]
    },
    {
        path: '/exchange',
        icon: 'android-sad',
        title: '交易所记录',
        name: 'exchange',
        access: [0,1,3],
        component: Main,
        children: [
            {
                path: 'commissionedBuy',
                title: '委托买入',
                name: 'commissionedBuy',
                component: () => import('@/views/exchange/commissionedBuy.vue')
            },
            {
                path: 'commissionedSell',
                title: '委托卖出',
                name: 'commissionedSell',
                component: () => import('@/views/exchange/commissionedSell.vue')
            },
            {
                path: 'buySuccess',
                title: '买入成功',
                name: 'aitcsfs',
                component: () => import('@/views/exchange/buySuccess.vue')
            },
            {
                path: 'sellSuccess',
                title: '卖出成功',
                name: 'sellSuccess',
                component: () => import('@/views/exchange/sellSuccess.vue')
            }
        ]
    },
    {
        path: '/ctc',
        icon: 'ios-analytics',
        title: 'CTC交易记录',
        name: 'ctc',
        access: [0,1],
        component: Main,
        children: [
            { path: 'index', title:'CTC交易记录', name: 'CTC_index', component: () => import('@/views/ctc/ctcBuy.vue') },
            { path: 'ctcSell', title:'CTC挂卖', name: 'ctcSell', component: () => import('@/views/ctc/ctcSell.vue') },
            { path: 'oreBuy', title:'CTC挂买', name: 'oreBuy', component: () => import('@/views/ctc/oreBuy.vue') }
        ]
    },
    // {
    //     path: '/CTCSH',
    //     icon: 'cloud',
    //     title: 'CTC冻结审核',
    //     access: [0,1],
    //     name: 'CTCSH',
    //     component: Main,
    //     children: [
    //         { path: 'CTCfreeze', title:'CTC冻结列表', name: 'CTCfreeze', component: () => import('@/views/CTCfreeze/CTCfreeze.vue') }
    //     ]
    // },
    {
        path: '/mill',
        icon: 'android-exit',
        name: 'mill',
        title: '矿机记录',
        access: [0,1,3],
        component: Main,
        children: [
            {
                path: 'masll',
                title: '矿机购买',
                name: 'masll',
                component: () => import('@/views/mill/mill.vue')
            },
            {
                path: 'principal',
                title: '本金提出',
                name: 'principal',
                component: () => import('@/views/mill/principal.vue')
            },
            {
                path: 'earnings',
                title: '收益提出',
                name: 'earnings',
                component: () => import('@/views/mill/earnings.vue')
            },
            {
                path: 'integral',
                title: '兑换积分',
                name: 'integral',
                component: () => import('@/views/mill/integral.vue')
            },
            {
                path: 'millSet',
                title: '矿机设置',
                name: 'millSet',
                component: () => import('@/views/mill/millSets.vue')
            }
        ]
    },
    {
        path: '/results',
        icon: 'briefcase',
        name: 'results',
        access: [0,1,3],
        title: '业绩报表',
        component: Main,
        children: [
            {
                path: 'newResults',
                title: '新增矿机',
                name: 'newResults',
                component: () => import('@/views/results/newResults.vue')
            },
            {
                path: 'totalSystem',
                title: '系统总额',
                name: 'totalSystem',
                component: () => import('@/views/results/totalSystem.vue')
            }
        ]
    },
    {
        path: '/identity',
        icon: 'social-buffer',
        name: 'identity',
        title: '用户身份审核',
        access: [0,2],
        component: Main,
        children: [
            {
                path: 'identityIndex',
                title: '用户身份审核',
                name: 'identityIndex',
                component: () => import('@/views/identity/identity.vue')
            }
        ]
    },
    {
        path: '/toplist',
        icon: 'social-buffer',
        name: 'toplist',
        title: '资产排行',
        access: [0,3],
        component: Main,
        children: [
            {
                path: 'CTClist',
                title: 'CTC排行榜',
                name: 'CTClist',
                component: () => import('@/views/toplist/CTClist.vue')
            },
            {
                path: 'oreList',
                title: '矿石排行榜',
                name: 'oreList',
                component: () => import('@/views/toplist/oreList.vue')
            },
            {
                path: 'lockList',
                title: '锁仓账户排行榜',
                name: 'lockList',
                component: () => import('@/views/toplist/lockList.vue')
            },
            {
                path: 'walletList',
                title: '钱包排行榜',
                name: 'walletList',
                component: () => import('@/views/toplist/walletList.vue')
            },
            {
                path: 'bbList',
                title: 'BB账户排行榜',
                name: 'bbList',
                component: () => import('@/views/toplist/bbList.vue')
            }
        ]
    },
    {
        path: '/qwe',
        icon: 'ios-grid-view',
        name: 'qwe',
        access: 10,
        title: '审核详情',
        component: Main,
        children: [
            {
                path: 'identity',
                title: '审核详情',
                name: 'identityInner',
                component: () => import('@/views/identity/identityInner.vue')
            }
        ]
    },
    {
        path: '/announcement',
        icon: 'edit',
        title: '公告管理',
        name: 'announcement',
        access: [0,1],
        component: Main,
        children: [
            {
                path: 'index',
                title:'公告管理',
                name: 'announcement_index',
                component: () => import('@/views/announcement/announcement.vue')
            }
        ]
    },
    {
        path: '/mall',
        icon: 'earth',
        title: '商城管理',
        name: 'mall',
        access: [0,1],
        component: Main,
        children: [
            {
                path: 'index',
                title: '商城管理',
                name: 'mall_index',
                component: () => import('@/views/mall/mall.vue')
            },
            {
                path: 'mallList',
                title: '订单详情',
                name: 'mallList',
                component: () => import('@/views/mall/shoppingList.vue')
            },
            {
                path: 'shopInner',
                title: '商品介绍',
                name: 'shopInner',
                component: () => import('@/views/mall/shopInner.vue')
            }
        ]
    },
    {
        path: '/autos',
        icon: 'ios-infinite',
        name: 'autos',
        title: '自动挂单',
        access: [0,3],
        component: Main,
        children: [
            { path: 'auto', title: '自动挂单', name: 'auto',
                component: () => import('@/views/auto/auto.vue') },
            { path: 'autoList', title: '自动挂单订单', name: 'autoList',
                component: () => import('@/views/auto/autoList.vue') }
        ]
    },
    {
        path: '/system',
        icon: 'gear-a',
        title: '系统管理',
        name: 'system',
        access: [0,1],
        component: Main,
        children: [
            { path: 'index', title:'系统管理', name: 'system_index', component: () => import('@/views/system/system.vue') }
        ]
    }

];
// 所有上面定义的路由都要写在下面的routers里
export const routers = [
    loginRouter,
    otherRouter,
    locking,
    ...appRouter,
    page500,
    page403,
    page404
];
